package org.deadline.service.baseapp;

import java.util.List;
import org.deadline.model.baseapp.SMSNotification;
import org.deadline.repository.baseapp.SMSNotificationRepository;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;


@Service
@Transactional
public class SMSNotificationServiceImpl implements SMSNotificationService {

	@Autowired
    SMSNotificationRepository sMSNotificationRepository;

	public long countAllSMSNotifications() {
        return sMSNotificationRepository.count();
    }

	public void deleteSMSNotification(SMSNotification SMSNotification_) {
        sMSNotificationRepository.delete(SMSNotification_);
    }

	public SMSNotification findSMSNotification(Long id) {
        return sMSNotificationRepository.findOne(id);
    }

	public List<SMSNotification> findAllSMSNotifications() {
        return sMSNotificationRepository.findAll();
    }

	public List<SMSNotification> findSMSNotificationEntries(int firstResult, int maxResults) {
        return sMSNotificationRepository.findAll(new org.springframework.data.domain.PageRequest(firstResult / maxResults, maxResults)).getContent();
    }

	public void saveSMSNotification(SMSNotification SMSNotification_) {
        sMSNotificationRepository.save(SMSNotification_);
    }

	public SMSNotification updateSMSNotification(SMSNotification SMSNotification_) {
        return sMSNotificationRepository.save(SMSNotification_);
    }
}
